package com.ymatou.app.seller.service;

import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;

public class CloseActivityCall extends YmatouBaseCall {
	
	private static String opurl = "/api/activity/CloseActivity";
	
	public CloseActivityCall() {
		super(EnvSetup.getSystemUrl("seller_app"), opurl, "POST", "PARAM");
	}
	
	@Override
	public void addDefHeader() {
		client.addHeader("Accept", "text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		//User-Agent: 02ios====8.4.1=DF50A6A6-0281-44BF-9D60-07412CE57EB1============================2.3.1=appStore========
		client.addHeader("User-Agent", "02ios====9.3===5F58DCEF-D449-46FF-81EF-02B569B9B260============================3.0.0=appStore========");
	}
	
	public int getStatus() {
		JSONObject response = null;
		int status = 0;
		
		try {
			response = new JSONObject(getReturnData());
			status = (Integer) response.get("Status");
			
			return status;
		} catch(Exception e) {
			e.printStackTrace();
			
			return 0;
		}
	}
}
